#ifndef SETTINGS_H_ED1B8BE5_DFD5_444B_B2EC_75F3EB295316_
#define SETTINGS_H_ED1B8BE5_DFD5_444B_B2EC_75F3EB295316_

// this is a container for common settings
struct tagGlobalSettings
{
	int8 nBPP;								// fullscreen only, bits-per-pixel to use for the display (must be a multiple of 8)
	int8 nVertRefresh;						// fullscreen only, verticle refresh rate to use for the display

	bool bInitialized;						// flag to determine if oatInitEngineWindowed() or oatInitEngineFullscreen() have been called
	bool bFullscreen;						// flag to determine if the application is to be run in fullscreen or not
	bool bOrthographic;						// flag to determine if the transformation matrix is orthographic or perspective
	bool bSilentErrors;						// do we suppress message boxes for error reporting?
	bool bSingleInstance;					// do we limit this appliction to only running a single instance?

	tchar szAppName[MAX_SMALLSTRING];		// application string name to use for various operations
	tchar szCompanyName[MAX_SMALLSTRING];	// company string name to use for various operations (not mandatory to set)

#ifdef _WIN32
	HWND hMainWindow;						// handle to the main window for the application
	HINSTANCE hEngineInstance;				// will store the instance handle to the DLL (windows only)
#endif
};

// declare an object of the settings container
extern struct tagGlobalSettings GlobalSettings;

// platform independent macros used for common settings
#define OAT_SETTING_ENGINE_NAME		_T("Oatmeal")
#define OAT_SETTING_ENGINE_VER		_T("1.0.3.14159")

#ifdef _WIN32
	// platform specific macros used for common settings
	#define OAT_SERIAL_BIN		REG_BINARY
	#define OAT_SERIAL_INT32	REG_DWORD
	#define OAT_SERIAL_INT64	REG_QWORD
	#define OAT_SERIAL_STRING	REG_SZ

	// use a macro to initialize default values for the global settings, doing this allows
	// us to not have to use yet another cluster of ugly #ifdefs in the source file
	#define OAT_SETTINGS_INIT	{8, 60, false, false, false, false, true, OAT_SETTING_ENGINE_NAME, _T(""), NULL, NULL}
#endif

// public prototypes
bool GetUserValue (const tchar *szSubkey, const tchar *szValue, const uint32 nType, void *pDest, const int32 nSize);
bool SetUserValue (const tchar *szSubkey, const tchar *szValue, const uint32 nType, const void *pData, const int32 nSize);

#endif  // SETTINGS_H_
